{{ $paginator := $.Scratch.Get "paginator" }}
<p class="art-list-summary">
	{{ T "archiveCounter" (len .Data.Pages) }}
</p>
<div class="art-archive-box">
  {{ range $index, $element := $paginator.Pages }}
    {{ $thisYear := $element.Date.Format "2006" }}
    {{ $lastElement := $index | add -1 | index $paginator.Pages }}
    {{ if or (eq $index 0) ( ne ($lastElement.Date.Format "2006") $thisYear ) }}
      <h2 class="archive-year">{{ $thisYear }}</h2>
    {{ end }}

    <div class="archive-item">
      <span class="time">
        {{ $element.Date.Format "01-02" }}
      </span>
      <span class="link">
        <a href="{{ $element.RelPermalink }}">
          {{ .Title }}
        </a>
      </span>
    </div>
  {{- end -}}
  {{ partial "pagination.html" . }}
</div>
